package com.service.impl;

import com.model.Student;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by CHUMI on 2017/7/6.
 */
@Service
public class StudentServiceImpl {
    @Autowired
    private SqlSessionFactory sqlSessionFactory;
    // 测试 Student
    public List<Student> selectStudent(int Id){
       // List<Student>  list=sqlSessionFactory.openSession().selectList("TbStudent.selectStudent",Id);
        List<Student>  list=new ArrayList<Student>();
         Student  s1=new Student();
         s1.setId(1);
         s1.setName("A1");
         s1.setAge(20);
         s1.setSex("男");
         list.add(s1);
        Student  s2=new Student();
        s2.setId(2);
        s2.setName("A2");
        s2.setAge(20);
        s2.setSex("女");
        list.add(s2);
        Student  s3=new Student();
        s3.setId(3);
        s3.setName("A3");
        s3.setAge(20);
        s3.setSex("男");
        list.add(s3);

        return  list;
    }
}
